<template>
    <div>
        <ul>
            <li v-for="(data, index) in datalist" :key="data" @click="handleClick">
                {{ data }}
            </li>
        </ul>
    </div>
</template>
<script setup>
import { inject, ref } from 'vue';

const datalist = ref(["aaa", "bbb", "ccc"])

const which = inject("which")

const handleClick = () => {
    //将父组件的which改为false
    which.value = false
}


</script>